import React, { memo } from "react"
import { HeaderWrapper } from "./style"
import HeaderLeft from "./c-cpns/header-left"
import HeaderCenter from "./c-cpns/header-center"
import HeaderRight from "./c-cpns/header-right"
import { useSelector } from "react-redux"
const AppHeader = memo(() => {
    // 从redux中获取数据
    const { headerConfig } = useSelector((state) => state.main)
    return (
        <HeaderWrapper className={headerConfig ? "fixed" : ""}>
            <HeaderLeft />
            <HeaderCenter />
            <HeaderRight />
        </HeaderWrapper>
    )
})

export default AppHeader
